package com.heima.article.service;

import com.heima.article.entity.ApArticle;
import com.baomidou.mybatisplus.extension.service.IService;
import com.heima.model.article.dtos.ArticleDto;
import com.heima.model.article.dtos.ArticleHomeDto;
import com.heima.model.article.dtos.ArticleInfoDto;
import com.heima.model.article.dtos.UserBehaviorMsgDto;
import com.heima.model.media.dtos.WmNewsDownOrUpDTO;
import com.heima.model.media.dtos.WmNewsResultDTO;
import com.heima.model.wemedia.dto.ArticleCommentManagementVO;
import com.heima.model.wemedia.dto.CommentManagementQueryDTO;

import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 * 文章信息表，存储已发布的文章 服务类
 * </p>
 *
 * @author HM
 * @since 2023-03-22
 */
public interface ApArticleService extends IService<ApArticle> {

    Long createArticle(WmNewsResultDTO dto);

    List<ApArticle> load(ArticleHomeDto dto);

    List<ApArticle> loadmore(ArticleHomeDto dto);

    List<ApArticle> loadnew(ArticleHomeDto dto);

    /**
     * article收到了自媒体上下架的消息之后的回调
     * */
    void downOrUp(WmNewsDownOrUpDTO toBean);

    List<ArticleDto> findByPage(int page, int size);

    ArticleDto findById(Long id);

    void delArticleByNewsId(Integer wmUserId, Integer wmNewsId);

    UserBehaviorMsgDto loadArticleBehavior(ArticleInfoDto dto);

    List<ApArticle> getLastestArticle(LocalDateTime localDateTime);

    List<ArticleCommentManagementVO> findNewsComments(CommentManagementQueryDTO dto);

    Integer findWmNewsIdByArticleId(Long id);

    void updateArticleEnableComment(ArticleDto articleDto);
}
